<?php
//error_reporting(E_COMPILE_ERROR|E_ERROR|E_CORE_ERROR);
require('./roots.php');
require($root_path.'include/inc_environment_global.php');

# Set break file
require('include/inc_breakfile.php');


# If cache must be deactivated, set $force_no_cache to true
$force_no_cache=1;

define('LANG_FILE','interconsulta.php');
define('NO_2LEVEL_CHK',1);
require_once('include/inc_local_user.php');
require_once($root_path.'include/inc_front_chain_lang.php');
require_once($root_path.'include/care_api_classes/class_core.php');
$core=new Core;

 /**
 * LOAD Smarty
 */

 require_once($root_path.'gui/smarty_template/smarty_care.class.php');
 $smarty = new smarty_care('common');

if($parent_admit) $sTitleNr= ($_SESSION['sess_full_en']);
	else $sTitleNr = ($_SESSION['sess_full_pid']);

# Title in the toolbar
$id = $_GET['id'];

$smarty->assign('sToolbarTitle',$LDMisInter);

$smarty->assign('breakfile',$breakfile);

# Window bar title
$smarty->assign('title',$LDBitacora);

# Buffer page output
$sTemp = ob_get_contents();
ob_end_clean();
$sTemp = '';
ob_start();

include_once($root_path.'include/care_api_classes/class_interconsulta.php');
$inter=new Interconsulta;

$bitacoras = $inter->getBitacora($id);
$msj = '';

//nunca deberia pasar porque es en consultar, peeeero...
if (!count($bitacoras))
{
    $msj = $LDBitacoraVacia;
}
?>
<table cellspacing="1" cellpadding="2" border="0" align="center">
<?php
	# Load the interconsultas
	if($bitacoras != NULL){
?>
		<tr class="reg_list_titlebar">
			<td align="center"><?php echo $LDDate; ?></td>
			<td align="center"><?php echo $LDEvento; ?></td>
		</tr>
<?php
		$pos=1;
		foreach($bitacoras as $bit){
?>
		<tr class="wardlistrow<?=$pos?>">
			<td align="center"><?=$bit['fecha']?></td>
			<td align="center"><?=$bit['mensaje']?></td>
		</tr>
<?php
			if ($pos==1){$pos=2;
			}else{	$pos=1;	}
		}
	}

$sTemp = ob_get_contents();
ob_end_clean();

$smarty->assign('msj', $msj);


# Assign the buffer output  to main frame template
$smarty->assign('sMainDataBlock',$sTemp);
$smarty->assign('sMainBlockIncludeFile','interconsulta/bitacora.tpl');

 /**
 * show Template
 */
 $smarty->display('common/mainframe.tpl');


?>

